package com.gilight.base.mapper;

import com.gilight.base.model.spu.SpuDO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by rize on 2019/7/2.
 */
@Repository
public interface SpuMapper extends IMapper<SpuDO> {

    /**
     * 仅可传入叶子类目
     * @param categoryId
     * @return
     */
    public List<SpuDO> getSpuTitleByCategoryId(Long categoryId);

    /**
     * 增加Spu累计销量
     * @param spuId
     * @param delta
     * @return
     */
    public Integer incSales(@Param("spuId") Long spuId,@Param("delta") Integer delta);

    public List<SpuDO> getSpuTitleAll();

    public List<SpuDO> getSpuTitleAllByZZJGID(Long zzjgId);

    public List<SpuDO> getSpuByCategoryId(@Param("categoryId") Long categoryId,@Param("status") Integer status);

}
